package org.cbyyx.tc.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.Data;

import java.util.Date;

/**
 * 商品表
 * @author cbyyx
 * @TableName products
 */
@TableName(value ="products")
@Data
public class Products {
    /**
     * 商品ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 商品名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 商品描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 商品价格
     */
    @TableField(value = "price")
    private Long price;

    /**
     * 商品状态
     */
    @TableField(value = "status")
    private String status;

    /**
     * 商品库存
     */
    @TableField(value = "stock")
    private Integer stock;

    /**
     * 商品分类
     */
    @TableField(value = "categoryId")
    private Integer categoryId;

    /**
     * 商品图片链接
     */
    @TableField(value = "imageUrl")
    private String imageUrl;

    /**
     * 创建时间
     */
    @TableField(value = "createTime")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "updateTime")
    private Date updateTime;

    /**
     * 商品销量
     */
    @TableField(value = "sales")
    private Integer sales;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;
}